package org.stvd.core.process;

import java.util.Arrays;

import org.stvd.core.web.MailUtil;

public class ReportBugThread extends Thread {

    private final String subject;
    private final String content;
    private final String[] address;

    public ReportBugThread(String subject, String content, String[] address) {
        this.subject = subject;
        this.content = content;
        if (address != null) {
            this.address = Arrays.copyOf(address, address.length);
        } else {
            this.address = null;
        }
    }

    public void run() {
        if (address != null) {
            MailUtil.sendEmail(subject, content, address);
        }
    }
}